<?php
if (!isset($_SESSION['user'])) {
    ?>
    <ul id="menu">
        <!-- put class="current" in the li tag for the selected page - to highlight which page you're on -->
        <li <?php if (strstr($_SERVER['PHP_SELF'],'index')) echo "class=\"current\""?>><a href="index.php">Trang chủ</a></li>
        <li <?php if (strstr($_SERVER['PHP_SELF'],'search')) echo "class=\"current\""?>><a href="advance_search.php">Tìm kiếm</a></li>
        <li <?php if (strstr($_SERVER['PHP_SELF'],'signup')) echo "class=\"current\""?>><a href="signup.php">Ðăng ký</a></li>
        <li <?php if (strstr($_SERVER['PHP_SELF'],'login')) echo "class=\"current\""?>><a href="login.php">Ðăng nhập</a></li>
        <li <?php if (strstr($_SERVER['PHP_SELF'],'contact')) echo "class=\"current\""?>><a href="contact.php">Về chúng tôi</a></li>
    </ul>
    <?php
} else if (isset($_SESSION['admin'])) {
    ?>
    <ul id="menu">
        <!-- put class="current" in the li tag for the selected page - to highlight which page you're on -->
        <li <?php if (strstr($_SERVER['PHP_SELF'],'index')) echo "class=\"current\""?>><a href="index.php">Trang chủ</a></li>
        <li <?php if (strstr($_SERVER['PHP_SELF'],'search')) echo "class=\"current\""?>><a href="advance_search.php">Tìm kiếm</a></li>
        <li <?php if (strstr($_SERVER['PHP_SELF'],'admin_function')) echo "class=\"current\""?>><a href="admin_function.php">Chức năng admin</a>
        <li <?php if (strstr($_SERVER['PHP_SELF'],'contact')) echo "class=\"current\""?>><a href="contact.php">Về chúng tôi</a></li>
        <li <?php if (strstr($_SERVER['PHP_SELF'],'logout')) echo "class=\"current\""?>><a href="modules/logout.php">Đăng xuất</a></li>
    </ul>
    <?php
} else {
    ?>
    <ul id="menu">
        <!-- put class="current" in the li tag for the selected page - to highlight which page you're on -->
        <li <?php if (strstr($_SERVER['PHP_SELF'],'index')) echo "class=\"current\""?>><a href="index.php">Trang chủ</a></li>
        <li <?php if (strstr($_SERVER['PHP_SELF'],'search')) echo "class=\"current\""?>><a href="advance_search.php">Tìm kiếm</a></li>
        <li <?php if (strstr($_SERVER['PHP_SELF'],'profile')) echo "class=\"current\""?>><a href="profile.php?user=<?php echo $_SESSION['user']; ?>">Thông tin về bạn</a></li>
        <li <?php if (strstr($_SERVER['PHP_SELF'],'cart')) echo "class=\"current\""?>><a href="cart.php?user=<?php echo $_SESSION['user']; ?>">Thông tin giỏ hàng</a></li>
        <li <?php if (strstr($_SERVER['PHP_SELF'],'contact')) echo "class=\"current\""?>><a href="contact.php">Về chúng tôi</a></li>
        <li <?php if (strstr($_SERVER['PHP_SELF'],'logout')) echo "class=\"current\""?>><a href="modules/logout.php">Đăng xuất</a></li>
    </ul>
    <?php
}
?>
